#define _CRT_SECURE_NO_WARNINGS 1
#include"sort.h"

void testInsertSort()
{
	int a[] = { 9,8,7,6,5,4,3,2,1,0 };
	int n = sizeof(a) / sizeof(a[0]);
	PrintSort(a, n);
	InsertSort(a, n);
	PrintSort(a, n);
}

void testShellSort()
{
	int a[] = { 9,8,7,6,5,4,3,2,1,0 };
	int n = sizeof(a) / sizeof(a[0]);
	PrintSort(a, n);
	ShellSort(a, n);
	PrintSort(a, n);
}

void testSelectSort()
{
	int a[] = { 9,8,7,6,5,4,3,2,1,0 };
	int n = sizeof(a) / sizeof(a[0]);
	PrintSort(a, n);
	SelectSort(a, n);
	PrintSort(a, n);
}

void testHeapSort()
{
	int a[] = { 9,8,7,6,5,4,3,2,1,0 };
	int n = sizeof(a) / sizeof(a[0]);
	PrintSort(a, n);
	HeapSort(a, n);
	PrintSort(a, n);
}

void testBubbleSort()
{
	int a[] = { 9,8,7,6,5,4,3,2,1,0 };
	int n = sizeof(a) / sizeof(a[0]);
	PrintSort(a, n);
	BubbleSort(a, n);
	PrintSort(a, n);
}

void testQuickSort()
{
	int a[] = {5,1,2,7,9,3,4,8,10,5,6,77,88,5,6,7,9,4,44,5,2,33,7,8,9,77 };
	int n = sizeof(a) / sizeof(a[0]);
	PrintSort(a, n);
	QuickSort(a, 0, n - 1);
	PrintSort(a, n);
}

void testQuickSortNonR()
{
	int a[] = { 5,1,2,7,9,3,4,8,10,5,6,77,88,5,6,7,9,4,44,5,2,33,7,8,9,77 };
	int n = sizeof(a) / sizeof(a[0]);
	PrintSort(a, n);
	QuickSortNonR(a, 0, n - 1);
	PrintSort(a, n);
}

void testMergeSort()
{
	int a[] = { 5,1,2,7,9,3,4,8,10,99,88,99,66,77,55,44,3,6,5,7,9,8,6 };
	int n = sizeof(a) / sizeof(a[0]);
	PrintSort(a, n);
	MergeSort(a, n);
	PrintSort(a, n);
}

void testMergeSortNonR()
{
	int a[] = { 10,6,7,1,3,9,8};
	int n = sizeof(a) / sizeof(a[0]);
	PrintSort(a, n);
	MergeSortNonR(a, n);
	PrintSort(a, n);
}

void testMergeSortFile()
{
	MergeSortFile("data.txt");
}

void testCountSort()
{
	int a[] = { 10,6,7,1,3,9,8 };
	int n = sizeof(a) / sizeof(a[0]);
	PrintSort(a, n);
	CountSort(a, n);
	PrintSort(a, n);
}

int main()
{
	//testInsertSort();
	//testShellSort();
	//testSelectSort();
	//testHeapSort();
	//testBubbleSort();
	testQuickSort();
	//testMergeSortNonR();
	//testMergeSortFile();
	//testCountSort();
	return 0;
}

